<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
            <title>曲线统计-单条</title>
            </head>
    <body>
        <!--Step:2 Prepare a dom for ECharts which (must) has size (width & hight)-->
        <!--Step:2 为ECharts准备一个具备大小（宽高）的Dom-->
        <div id="main" style="height:200px; width:100%;"></div>
        
    </body>
    <!--Step:1 Import echarts-plain.js or echarts-plain-map.js-->
    <!--Step:1 引入echarts-plain.js或者 echarts-plain-map.js-->
    <script src="echarts.min.js"></script>
    <script src="jquery.min.js"></script>
    <script type="text/javascript">
        $(function(){
 
     })

          function show(data,data2,name){
              var myChart = echarts.init(document.getElementById('main'));
              <!--            var datas = new Array();-->
              <!--            datas  = data.split("-");-->
              <!--            var x= datas[0];-->
              <!--            var x1 = eval('[' + x + ']');-->
              <!--            var y = datas[1];-->
              <!--            var y1 = eval('[' + y + ']');-->
              
              
              
          
              
              option = {
                  title: {
                      subtext:name
                  },
                  tooltip : {
                      trigger: 'axis'
                  },
                  
                  toolbox: {
                      feature: {
                          saveAsImage: {}
                      }
                  },
                  grid: {
                      left: '3%',
                      right: '4%',
                      bottom: '3%',
                      containLabel: true
                  },
                  xAxis : [
                           {
                           type : 'category',
                           boundaryGap : false,
                           splitLine : {
                           show:false,
                           lineStyle: {
                           color: '#483d8b',
                           type: 'dashed',
                           width: 0
                           }
                           },
                           data : data
                           }
                           ],
                           yAxis : [
                                    
                                    {
                                    type : 'value',
                                    max:4, /*xhw2018-2-2加:大于4就不会出现小数*/
                                    splitLine : {
                                    show:true,
                                    lineStyle: {
                                    color: '#f1f1f1',
                                    type: 'dashed',
                                    width: 1
                                    }}
                                    }
                              
                                    ],
                                    series : [
                                              {
                                              name:'',
                                              type:'line',
                                              stack: '总量',
                                              symbol:'none',
                                              show:false,
                                              label: {
                                              normal: {
                                              show: false,
                                              position: 'top'
                                              }
                                              },
                                              areaStyle: {normal: {}},
                                              data:data2
                                              }
                                              ]
              };
              
              
              myChart.setOption(option);
              <!--            var html = "<div style='z-index: 99;position: absolute;margin-top: -108px;margin-left: 40%;'>"+-->
              <!--            "<div style='margin-bottom: 10px;margin-left: 10px;font-size: 12px;"+-->
              <!--            "color: #C5BDBD;'>总收益</div><div>123.00元</div></div>";-->
              <!--                   $("#main").append(html);-->
              
          }
    
    
        </script>
</html>
